<%@ include file="../taglib.jsp"%>
<!-- PRODUCT INFO -->

<div ng-controller="ProductViewCtrl" class="container-fluid"
	style="margin-top: 30px;">
	<div class="row-fluid whitebg">
		<div class="span4">
			<div id="product-single-image"
				class="product-single-image paddingtop"
				style="width: 50%; margin: auto;">
				<img ng-src="{{item.imageUrl}}" style="width: 100%;">
			</div>
		</div>
		<div class="span8 product-single-meta">
			<h1>{{item.name}}</h1>
			<span>{{item.dcrp}}</span>
			<div class="row-fluid">
				<span>Find {{item.storeCount}} store that sale this product.</span>
			</div>
			<div class="row-fluid">
				<span>Lowest price: {{item.minPrice}}</span>
			</div>
		</div>
	</div>
</div>

<!-- DETAILS INFO -->
<div class="container-fluid">
	<div class="span12">
		<h2>DETAIL AT STORE:</h2>
	</div>
</div>

<div ng-controller="DetailViewCtrl" class="container-fluid">
	<div class="row-fluid whitebg">
		<table class="table table-striped">
			<thead>
				<th width="10%" style="text-align: center;">Image</th>
				<th style="text-align: center;">Description</th>
				<th width="16%" style="text-align: center;">Store</th>
				<th width="18%" style="text-align: center;">Price</th>
			</thead>
			<tbody>
				<tr ng-repeat="item in items">
					<td><img alt="" ng-src="{{item.imageUrl}}" /></td>
					<td><a target="_blank" ng-href="{{item.productUrl}}"><h4>{{item.productName}}</h4></a>
					</td>
					<td style="text-align: center;">
						<!-- 
						<div class="row-fluid">
							<span><h5>{{item.storeName}}</h5></span>
						</div>
						 -->
						<div class="row-fluid">
							<img alt=""
								ng-src="<spring:message code="domain"/>/img/store/{{item.storeImageUrl}}" />
						</div>
						<div class="row-fluid">
							<span ng-repeat="region in item.regions">{{region.name}}<span
								ng-hide="item.regions.length==1 || $index == item.regions.length-1">,
									<span></span>
						</div>

					</td>
					<td><a target="_blank" ng-href="{{item.productUrl}}"><h1>{{item.price}}</h1></a>
						<em>Update at: {{item.date}}</em></td>
				</tr>
			</tbody>
		</table>
	</div>
</div>